package com.zhou.test;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/BServlet")
public class BServlet extends BaseServlet {
	public String  fun1(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("fun1");
		resp.setContentType("text/html,charset=utf-8");
		resp.setCharacterEncoding("utf-8");
		resp.getWriter().print("fun1");
		return "forward:/index.jsp";
	}
	public String fun2(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("fun2");
		resp.getWriter().print("fun2");
		return "redirect:/http://www.baidu.com";
	}
	public String fun3(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("fun3");
		resp.getWriter().print("fun3");
		return null;
	}
}
